import http from '@/utils/request.js';
import {
	hanleToken
} from '@/utils/utils.js';
export const getRoutes = (data) => {
	// return http.get('/blade-system/menu/routes', data);
	return http.request({
		url: '/blade-system/menu/routes',
		method: 'get',
		data,
	});
};
 
// 上报定位
export const postAddress = (data) => {
	try {
		getApp().globalData.seed = 60;
		if (!hanleToken('get', 'token') ) {
			return;
		}
	} catch (error) {
		console.log(error);
	}
	//  http.post('/trajectory/record', data, 1, false);
	return http.request({
		url: '/trajectory/record',
		method: 'post',
		data,
		textJson: 1,
		toast:false
	});
};

// 获取进行中救援工单
export const getRescusIng = (data) => {
	// return http.get('/repair/maintain/malfunction/rescue/rescueUserRunning', data, 1, false);
	return http.request({
		url: '/repair/maintain/malfunction/rescue/rescueUserRunning',
		method: 'get',
		data,
		toast: 1,
		timeout: false,
	});
};

// 预警工单列表
export const getOfToday = (data) => {
	// return http.get('/repair/maintain/malfunction/work/user/planList/OfToday', data, 1, false);
	return http.request({
		url: '/repair/maintain/malfunction/work/user/planList/OfToday',
		method: 'get',
		data,
		toast: 1,
		timeout: false,
	});
};
// 预警规则
export const getOfRule = (data) => {
	// return http.get('/repair/wx/msg/type/detail', data, 1, false);
	return http.request({
		url: '/repair/wx/msg/type/detail',
		method: 'get',
		data,
		toast: 1,
		timeout: false,
	});
};
